fn main() {
    let p1 = Person {
        name: String::from("章三"),
        age: 12,
    };

    let p2 = Person { ..p1 };

    println!("{:?}", p2);

    let Person { name, age } = p2;
    println!("{}{}", name, age);

    // 实例化一个元组结构体
    let pair = Pair(1, 0.1);

    // 访问元组结构体的字段
    println!("pair contains {:?} and {:?}", pair.0, pair.1);
}

// 元组结构体
struct Pair(i32, f32);

#[derive(Debug)]
struct Person {
    name: String,
    age: u32,
}
